class Spacecraft {
  String name;
  DateTime? launchDate;

  Spacecraft(this.name, this.launchDate);

  void describe() {
    print('航天器: $name');
    if (launchDate != null) {
      print('发射日期: $launchDate');
    } else {
      print('未发射');
    }
  }
}

class Orbiter extends Spacecraft {
  double altitude;

  Orbiter(super.name, DateTime super.launchDate, this.altitude);

  @override
  void describe() {
    super.describe();
    print('轨道高度: $altitude km');
  }
}

void main() {
  var orbiter = Orbiter('Hubble', DateTime(1990, 4, 24), 547);
  orbiter.describe();
}
